#ifndef NANE_REFCOUNT_H
#   define NANE_REFCOUNT_H

#   include "types.h"

namespace nane
{
    template<class C>
    class RefCount
        : public C
    {
    public:
        RefCount()
            : C()
            , m_ref(0)
        {

        }
        uint32 addRef()
        {
            return ++m_ref;
        }
        uint32 releaseRef()
        {
            return --m_ref;
        }
    private:
        uint32 m_ref;
    };
}   // namespace nane

#endif	// NANE_REFCOUNT_H
